Skip to content

Get File
Beta

Request

In DAM, files are identified by their filename (reference), which is unique per tenant. Use this endpoint to retrieve a specific file when you already know its filename.

Authentication

Requires a valid API key in the X-API-KEY header.

Example

GET /files(product-datasheet.pdf)
X-API-KEY: your-api-key-here

Response (200 OK)

The file is wrapped in the house entity envelope — its fields are under value, never at the top level:

{
  "value": {
    "reference": "product-datasheet.pdf",
    "numLinks": 3,
    "status": "Ok",
    "modifiedOn": "2024-04-05T08:44:33Z",
    "fileType": "pdf",
    "createdOn": "2024-04-05T08:44:33Z",
    "tags": ["datasheets", "catalog"],
    "url": "https://cdn.example.com/product-datasheet.pdf",
    "sizeInBytes": 102400
  },
  "@readLink": "https://api2.saleslayer.com/dam/files(product-datasheet.pdf)",
  "@editLink": "https://api2.saleslayer.com/dam/files(product-datasheet.pdf)"
}

Notes on the payload:

  • status tells you whether the file is usable yet — see the status values documented on GET /files.
  • url and sizeInBytes come from the stored metadata and are empty / 0 until processing has recorded them.
  • tags is stored as a comma-separated string, so a tag that itself contains a comma comes back split into several tags.
  • @readLink and @editLink are the canonical URL of this file (this request, echoed back), and are only emitted when hypermedia enrichment is configured for the deployment.

Error Responses

  • 401 Unauthorized: Missing or invalid API key. Returned by the API gateway as { "message": "Unauthorized", "request_id": "d8aafa5b8f3e400b60bea0123dd33317" }
  • 403 Forbidden: The API key does not have read permissions for this operation. Same body shape as the 401
  • 404 Not Found: No file with the given reference exists for this tenant. The body is the message string, e.g. "File with reference 'missing.pdf' was not found."
  • 500 Internal Server Error: Technical error (e.g. database unavailable)
Path
referencestringrequired

File name, unique per tenant (e.g. product-datasheet.pdf)

Headers
X-API-KEYstringrequired

Tenant's API key (required)

curl -i -X GET \
  'https://api2.saleslayer.com/dam/files({reference})' \
  -H 'X-API-KEY: string'

Responses

OK

Bodyapplication/json
valueobject(FileDto)

A file asset.

Response
{ "value": { "reference": "string", "numLinks": 0, "status": "string", "modifiedOn": "2019-08-24T14:15:22Z", "fileType": "string", "createdOn": "2019-08-24T14:15:22Z", "tags": [ … ], "url": "string", "sizeInBytes": 0 }, "@readLink": "string", "@editLink": "string" }